package com.example.administrator.myapplication.adapter;


import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;

import com.example.administrator.myapplication.MainActivity;

import java.util.ArrayList;

/**
 * Created by Administrator on 2020/12/15.
 */

public  class Myadapter extends FragmentPagerAdapter {
    Context context;
    ArrayList fragmentList;

    public Myadapter(FragmentManager fm,Context context,ArrayList fragmentList) {
        super(fm);
        this.context = context;
        this.fragmentList= fragmentList;
    }

    public Myadapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return (Fragment) fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }


}

